<template>
  <m-modal
    v-model="visible"
    title="创建/编辑对象流"
    okText="确定"
    @ok="handleOk"
    @cancel="handleCancel">
    <m-attribute ref="attr" :elementId="elementId"/>
  </m-modal>
</template>
<script>
import { Portal } from 'src/components/common/Portal.vue';
import Modal from 'src/components/common/CustomModal';
import WizardAttribute from '../comps/WizardAttribute';

const comp = {
  name: 'comp-attribute-detail',
  components: {
    'm-modal': Modal,
    'm-attribute': WizardAttribute
  },
  props: {
    elementId: String
  },
  data() {

    return {
      visible: false,

    };
  },
  mounted(){
    this.visible = true;
  },

  methods: {
    handleOk(){
      this.visible = false;
      const tableData = this.$refs.attr.$refs.comp.tableData;
      let context = this;
      this.$emit('sure', { tableData, context });

    },
    handleCancel(){
      this.visible = false;
      this.$emit('close');
    }
  }
};
export default comp;
export const wizardAttributeDetail = new Portal(comp);
export const portal = wizardAttributeDetail;
</script>
<style lang="scss">
</style>
